from win32com.client import Dispatch
import os
class DM:
    def __init__(self):
        try:
            self.dm = Dispatch('dm.dmsoft')  # 调用大漠插件
            print('插件加载成功')
        except:
            os.system('regsvr32 dm.dll /s')
            print('动态库注册成功')
            self.dm = Dispatch('dm.dmsoft')  # 调用大漠插件
            print('插件加载成功')
        reged=self.dm.RegEx("qq760471367f21b0879268408e5096b92cb022804da", "vvv0000", "58.218.204.170")
        print("插件注册:%s", reged)
        shield=self.dm.DmGuard(1, "np")
        print("NP盾:%s", shield)
        shield=self.dm.DmGuard(1, "memory")
        print("memory盾:%s", shield)

        shield=self.dm.DmGuard(1, "memory2")
        print("memory2盾:%s", shield)
        #
        # shield=self.dm.DmGuard(1, "display2")
        # print("display2盾:%s", shield)
        # shield=self.dm.DmGuard(1, "b3")
        # print("b3盾:%s", shield)
        shield=self.dm.DmGuard(1, "f1")
        print("f1盾:%s", shield)
        shield=self.dm.DmGuard(1, "hm dm.dll 1")
        print("hm盾:%s", shield)
        #
        shield=self.dm.DmGuard(1, "h1")
        print("h1盾:%s", shield)

        shield = self.dm.DmGuard(1, "inject 2 8176 <C:\Windows\SysWOW64\dm.dll> <1 1 1 1>")
        print("注入:%s", shield)
    def destory(self):
        os.system('regsvr32 dm.dll /s')
        print('动态库卸载成功')